import io.reactivex.Observable;

public class C24 {
    public static void main(String[] args) {
        /* There are other flavors of elementAt(), such as elementAtOrError(), 
         * which return a Single and will emit an error if an element at that 
         * index is not found. singleElement() will turn an Observable into a Maybe, 
         * but will produce an error if there is anything beyond one element. 
         * Finally, firstElement() and lastElement() will yield, maybe emitting 
         * the first or last emission, respectively.
         */
        Observable.just("Alpha", "Beta", "Zeta", "Eta", "Gamma", "Delta")
                  .elementAt(3)
                  .subscribe(i -> System.out.println("RECEIVED: " + i));
    }

}
//EOP
